package com.hts.spring02.factory;

import com.hts.spring02.entity.Car;
import com.hts.spring02.entity.User;
import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * implements : 实现接口, 干爹
 * extends: 继承类
 *
 */
@Component
public class CarFactory  implements FactoryBean<Car> {


    @Override
    public Car getObject() throws Exception {
        Car car = new Car();
        car.setBrand("小米 su7");
        car.setPrice(300000.0);
        return car;
    }

    @Override
    public Class<?> getObjectType() {
        return Car.class;
    }

    /**
     * 是否单例: true 单例, false 非单例 默认是true
     * @return
     */
    @Override
    public boolean isSingleton() {
        return false;
    }
}
